#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
	int num;
	cin >> num;
	if (0 <= num && num <= 1000)
	{
		if (num % 2 == 0 && (num > 4 && num <= 12))
			cout << 1 << ' ';
		else cout << 0 << " ";


		if ((num % 2 == 0) || (num > 4 && num <= 12) || ((num > 4 && num <= 12) && (num % 2 == 0)))
			cout << 1 << ' ';
		else cout << 0 << ' ';


		if(  ((4<num&&num<=12)&&(num%2!=0))||((num<=4||num>12)&&(num%2==0))    )
			cout << 1 << ' ';
		else cout << 0 << ' ';


		if ((num <= 4 ||num>12)&& (num % 2 !=0))
			cout << 1 << ' ';
		else cout << 0 << ' ';
	}
	return 0;
}